package com.cmic.rcs.emoji.controller;

import com.cmic.origin.DataEncryptUtil;
import com.cmic.rcs.emoji.entity.dto.EnterpriseMemberRequest;
import com.cmic.rcs.emoji.entity.pojo.TAdmin;
import com.cmic.rcs.emoji.mapper.TAdminMapper;
import com.cmic.rcs.emoji.util.AESUtils;
import com.cmic.rcs.enhance.message.g5.core.common.Response;
import com.cmic.rcs.enhance.message.g5.core.common.ResponseData;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/hello")
@Slf4j
public class HelloController {

    @Autowired
    private AESUtils aesUtils;
    @GetMapping("/world")
    public Response helloWorld(@RequestParam String request) {
        log.info("收到请求：{}", request);
        //数据解密
        String decrypt = aesUtils.decrypt(request, "pXfIZ1nravvQpA7sSEthfLlr9xgnGzYs", "0000000000000000");
        log.info("解密后：{}", decrypt);
        //加密数据
        String encrypt = aesUtils.encrypt(decrypt, "pXfIZ1nravvQpA7sSEthfLlr9xgnGzYs", "0000000000000000");
        return ResponseData.OK(decrypt);
    }

}
